## Process this file with automake to produce Makefile.in

# This is so we can #include <glog/foo>
AM_CPPFLAGS = -I$(top_srcdir)/src/include/logging

# This is mostly based on configure options
AM_CXXFLAGS =

# These are good warnings to turn on by default
if GCC
  AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
endif

# These are x86-specific, having to do with frame-pointers
if X86_64
if ENABLE_FRAME_POINTERS
  AM_CXXFLAGS += -fno-omit-frame-pointer
else
  # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS),
  #                 before setting this.
  AM_CXXFLAGS += -DNO_FRAME_POINTER
endif
endif

#glogincludedir = glog
## The .h files you want to install (that is, .h files that people
## who install this package can include in their own applications.)
## We have to include both the .h and .h.in forms.  The latter we
## put in noinst_HEADERS.
#gloginclude_HEADERS = glog/log_severity.h
#nodist_gloginclude_HEADERS = glog/logging.h glog/raw_logging.h glog/vlog_is_on.h glog/stl_logging.h
#noinst_HEADERS = glog/logging.h.in glog/raw_logging.h.in glog/vlog_is_on.h.in glog/stl_logging.h.in
headers = glog/log_severity.h glog/logging.h glog/raw_logging.h glog/vlog_is_on.h glog/stl_logging.h

# The libraries libglog depends on.
COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS)

## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS

noinst_lib_LTLIBRARIES = libglog.la
noinst_libdir = `pwd`
#noinst_LIBRARIES = libglog.a
libglog_la_SOURCES = $(headers)$ \
                       logging.cc raw_logging.cc vlog_is_on.cc \
                       utilities.cc utilities.h \
                       demangle.cc demangle.h \
                       stacktrace.h \
                       stacktrace_generic-inl.h \
                       stacktrace_libunwind-inl.h \
                       stacktrace_powerpc-inl.h \
                       stacktrace_x86-inl.h \
                       stacktrace_x86_64-inl.h \
                       symbolize.cc symbolize.h \
                       signalhandler.cc \
                       base/mutex.h base/googleinit.h \
                       base/commandlineflags.h googletest.h
#nodist_libglog_la_SOURCES = $(nodist_gloginclude_HEADERS)

libglog_la_CXXFLAGS = $(PTRHEAD_CFLAGS) $(GFLAGS_CFLAGS) $(AM_CXXFLAGS) -DNDEBUG
libglog_la_LDFLAGS = -static $(PTRHEAD_CFLAGS) $(GFLAGS_LDFLAGS)
libglog_la_LIBADD = $(COMMON_LIBS)

## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
